<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="./lib/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="./lib/bootstrap-validator/css/bootstrapValidator.min.css">
    <link rel="stylesheet" href="./lib/nprogress/nprogress.css">
    <link rel="stylesheet" href="./css/common.css">

    <title>二级分类</title>
</head>

<body>
    <!-- 左侧菜单栏 -->
    <div class="lt_aside">
        <div class="brand">
            <a href="javascript:;">后台管理</a>
        </div>
        <div class="user">
            <img src="./images/default.png" alt="">
            <p>超级管理员</p>
        </div>
        <div class="nav">
            <ul>
                <li><a href="user.html"><i class="glyphicon glyphicon-user"></i><span>用户管理</span></a></li>
                <li>
                    <a href="#" class="category"><i class="glyphicon glyphicon-list"></i><span>分类管理</span></a>
                    <div class="child">
                        <a href="first.html">一级分类</a>
                        <a href="second.html" class=" current">二级分类</a>
                    </div>
                </li>
                <li><a href="product.html"><i class="glyphicon glyphicon-tags"></i><span>商品管理</span></a></li>
            </ul>
        </div>
    </div>
    <!-- 右侧导航 -->
    <div class="lt_main">
        <div class="lt_topbar">
            <a href="javascript:;" class="pull-left icon_menu"><i class="glyphicon glyphicon-align-justify"></i></a>
            <a href="javascript:;" class="pull-right icon_logout"><i class="glyphicon glyphicon-log-out"></i></a>
        </div>
        <div class="container-fluid">
            <ol class="breadcrumb">
                <li><a href="index.html">管理系统</a></li>
                <li class="active">分类管理</li>
                <li class="active">二级分类</li>
            </ol>



            <!-- 内容 -->
            <div class="lt_content">
                <button type="button" class="btn btn-default mb-20" data-toggle="modal" data-target="#addModal">添加分类</button>
                <table class="table table-bordered table-hover mb-20" id="">
                    <thead>
                        <tr>
                            <th>序号</th>
                            <th>一级分类名称</th>
                            <th>二级分类名称</th>
                            <th>二级分类LOGO</th>
                        </tr>
                    </thead>
                    <tbody>
                        <!-- <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr> -->
                    </tbody>
                </table>
                <!-- 分页器父盒子 -->
                <div class="text-right">
                    <ul id="pagintor"></ul>
                </div>
            </div>
        </div>

    </div>

    <!-- 模态框 -->
    <!-- Button trigger modal -->


    <!-- Modal -->
    <div class="modal fade " id="addModal">
        <div class="modal-dialog modal-sm" role="document">
            <div class="modal-content ">
                <div class="modal-header">
                    <button type="button" class="close " data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">添加二级分类</h4>
                </div>

                <form id="form">
                    <div class="modal-body">
                        <!-- 模态框样式 -->

                        <!-- 选择分类 -->
                        <div class="dropdown">
                            <div class="form-group">
                                <button class="btn btn-default mb-20" id="dLabel" type="button" data-toggle="dropdown">
                                    <span class="dropdownText">请选择一级分类</span>
                                    <span class="caret"></span>
                                </button>
                                <!-- 一级分类列表 -->
                                <ul class="dropdown-menu">
                                    <li><a href="javascript:;">aaa</a></li>
                                </ul>
                                <!-- 隐藏域 -->
                                <input type="hidden" id="categoryId" name="categoryId">
                            </div>
                        </div>

                        <!-- 输入分类 -->
                        <div class="form-group">
                            <input type="text" name="brandName" class="form-control" id="" placeholder="请输入二级分类">
                        </div>

                        <!-- 上传图片 -->
                        <div class="form-group">
                            <label for="fileupload" class="btn btn-default">上传图片</label>
                            <input type="file" multiple class="form-control" id="fileupload" name="pic1" data-url="/product/addProductPic" style="display: none;">
                        </div>

                        <!-- 图片隐藏域 -->
                        <div class="form-group" id="imgBox">
                            <!-- <label for="exampleInputPassword1">Password</label> -->
                            <img src="./images/default.png" alt="" height="80" class="">
                            <input type="hidden" name="brandLogo" data-bv-field="brandLogo">
                        </div>
                    </div>
                </form>

                <div class="modal-footer">
                    <button type="button" class="btn btn-default cancelling" data-dismiss="modal">取消</button>
                    <button type="submit" form="form" class="btn btn-primary">确定</button>
                </div>
            </div>
        </div>
    </div>




    <!-- 渲染一级分类 -->
    <script type="text/html" id="secondTpl">
        {{each rows v i}}
            <li><a href="javascript:;" data-id="{{v.id}}">{{v.categoryName}}</a></li>
        {{/each}}
    </script>


    <!-- 二级分类模板引擎 -->
    <script type="text/html" id="tem">
        {{each rows v i}}
            <tr>
                <td>{{ i + 1 + (page - 1) *size }}</td>
                <td>{{v.categoryName}}</td>
                <td>{{v.brandName}}</td>
                <td><img src="{{v.brandLogo}}" alt="" height="50"></td>
            </tr>
        {{/each }}
    </script>

    <script src="./lib/jquery/jquery.min.js"></script>
    <script src="./lib/bootstrap/js/bootstrap.min.js"></script>
    <script src="./lib/bootstrap-validator/js/bootstrapValidator.min.js"></script>
    <script src="./lib/nprogress/nprogress.js"></script>
    <script src="./lib/echarts/echarts.min.js"></script>
    <script src="./lib/artTemplate/template-web.js"></script>
    <script src="./lib/bootstrap-paginator/bootstrap-paginator.min.js"></script>
    <script src="./lib/jquery-fileupload/jquery.ui.widget.js"></script>
    <script src="./lib/jquery-fileupload/jquery.fileupload.js"></script>
    <script src="./js/logout.js"></script>
    <script src="./js/common.js"></script>
    <script src="./js/second.js"></script>



</body>

</html>